<template>
  <a-button
    :type="disabled ? 'link' : 'primary'"
    :size="size"
    @click="open = true"
  >
    {{ t(disabled ? "查看文件" : "上传文件") }}
  </a-button>
  <upload-modal
    :open="open"
    v-bind="props"
    @cancel="open = false"
  ></upload-modal>
</template>
<script lang="ts" setup>
import { ref } from "vue";
import { useI18n } from "vue-i18n";
import UploadModal from "./upload-modal.vue";
import type { Props } from "../typing";

const props = defineProps<Props>();
const { t } = useI18n();
const open = ref(false);
</script>
